Initializes a new instance of the
ConcurrentBag<(Of <(T>)>)
class that contains elements copied from the specified collection.
Namespace:
System.Collections.Concurrent
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Sub New ( _
collection As IEnumerable(Of T) _
) |
C# |
---|
public ConcurrentBag(
IEnumerable<T> collection
) |
Parameters
- collection
- Type: System.Collections.Generic..::.IEnumerable<(Of <(T>)>)
The collection whose elements are copied to the new ConcurrentBag<(Of <(T>)>).
Exceptions
Exception | Condition |
---|
System..::.ArgumentNullException | collection is a null reference
(Nothing in Visual Basic). |
See Also